<?php use common\models\Article;
$this->beginBlock('title'); ?>二狐手游网首页<?php $this->endBlock();?>
<?php if(isset($ucsynclogout)){ echo $ucsynclogout;}?>
<!--banner-->
<div class="swiper-container">
    <div class="swiper-wrapper">
        <?php foreach($advertise as $ad):?>
            <div class="swiper-slide"><a href="<?=$ad['url'];?>"><img src="<?=filepath($ad['img_path']);?>" /><span><?=$ad['title'];?></span></a></div>
        <?php endforeach;?>
    </div>
    <!-- Add Pagination -->
    <div class="swiper-pagination"></div>
</div>
<script type="text/javascript" src="<?= \Yii::$app->request->baseUrl;?>/js/swiper.min.js"></script>
<script type="text/javascript">
    var swiper = new Swiper('.swiper-container', {
        pagination: '.swiper-pagination',
        paginationClickable: true,
		autoplayDisableOnInteraction : false,
        speed:800,
		autoplay : 3000,
		loop : true,
    });
</script>

<!--游戏资讯-->
<div class="me_shadow public">
    <div class="tit"><p class="p1">游戏资讯</p></div>
    <div class="game_news">
        <ul>
            <?php foreach($articles as $article):?>
            <li><span><a href="<?php if($article['kind']==Article::KIND_NEWS){ echo Yii::$app->urlManager->createUrl('/article/news-list');}elseif($article['kind']==Article::KIND_ACTIVITY){echo Yii::$app->urlManager->createUrl('/article/activity-list');}?>">[<?=$article['kind']==1?'新闻':'活动';?>]</a></span><p><a href="<?=Yii::$app->urlManager->createUrl(['/article/detail','id'=>$article['id']]);?>"><?=truncate($article['title'],25);?></a></p></li>
            <?php endforeach;?>
        </ul>
    </div>
    <div class="morelist"><a href="<?=Yii::$app->urlManager->createUrl('/article/news-list');?>">浏览更多资讯</a></div>
</div>

<!--热门游戏-->
<div class="me_shadow public">
    <div class="tit"><p class="p2">热门游戏</p></div>
    <div class="hot_game">
        <ul>
            <?php foreach($game_hot as $hot):?>
            <li><a href="<?=Yii::$app->urlManager->createUrl(['/game/detail','version_id'=>$hot['id']]);?>">
               <p class="p1"><img src="<?=filepath($hot['game']['game_logo']);?>" class="myimg"></p>
               <p class="p2">
                  <span class="span1"><?=$hot['game']['game_name']?></span>
                  <span class="span2"><?=$hot['version_size'].'MB';?> <br>
                  <i>
                    <?php if(!empty($hot['game']['types'])):?>
                        <?php foreach ($hot['game']['types'] as $key=>$type):?>
				            <?php if(count($hot['game']['types'])==$key+1){ echo $type['type_name'];}else{ echo $type['type_name'].','; }?>
				        <?php endforeach;?>
                    <?php endif;?>
				  </i>
                                    下载：<em><?=$hot['game']['game_downclick'];?></em></span>
               </p>
               <p class="p3"><span>下载</span></p>
            </a></li>
            <?php endforeach;?>
        </ul>
    </div>
    <div class="morelist"><a href="<?=Yii::$app->urlManager->createUrl('/game/index');?>">查看更多游戏</a></div>
</div>

<!--新游上线-->
<div class="me_shadow public">
     <div class="tit"><p class="p3">新游上线</p></div>
     <div class="new_online">
        <ul class="clearfix">
            <?php foreach($game_latest as $latest):?>
            <li><a href="<?=Yii::$app->urlManager->createUrl(['/game/detail','version_id'=>$latest['id']]);?>"><img src="<?=filepath($latest['game']['game_logo']);?>" class="myimg"><span><?=$latest['game']['game_name'];?></span><em>下载</em></a></li>
            <?php endforeach;?>
        </ul>
     </div>
     <div class="morelist"><a href="<?=Yii::$app->urlManager->createUrl('/game/index');?>">查看更多游戏</a></div>
</div>

<!--游戏分类-->
<div class="me_shadow public">
    <div class="tit"><p class="p4">游戏分类</p></div>
    <div class="game_classify">
        <ul class="clearfix">
            <?php foreach($game_types as $item):?>
                <li><a href="<?=Yii::$app->urlManager->createUrl(['/game/list','type_alias'=>$item['alias']]);?>"><img src="<?=filepath($item['pic']);?>"><span><?=$item['type_name'];?></span></a></li>
            <?php endforeach;?>
            <li><a href="<?=Yii::$app->urlManager->createUrl('/game/index');?>"><img src="img/myico.png"><span>更多</span></a></li>
        </ul>
    </div>
</div>